<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/view/main/stylesheet.jsp"%>
<script src="${baseurl}/styles/frameword/js/jquery.validate.min.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="${baseurl}/styles/frameword/css/add.css" />
<script src="${baseurl}/styles/frameword/js/validate.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	$(function() {
		$("#close-button").click(function() {
			var index = parent.layer.getFrameIndex(window.name);
			parent.layer.close(index);
		});
		var url = "/pro-map-advertising/";
		var rules = {
			name : {
				required : true
			},
			password : {
				required : true
			},
		};
		validate("form1", rules, call)
		function call(param, form) {
			$.post(baseUrl + url + "add", param, function(data) {
				if (data.success) {
					window.location.href = baseUrl + '/result/success';
				} else {
					window.location.href = baseUrl + '/result/failure';
				}
			});
		}
	})
</script>
</head>
<body>
	<form class="bs-example bs-example-form" role="form" id="form1">
		<table class="table noline">
			<tbody>
				<tr>
					<td>
						<div class="input-group">
							<span class="input-group-addon explain">推广人数</span>
							<input type="text" name="promotionNumber" class="form-control">
						</div>
					</td>
					<td>
						<div class="input-group">
							<span class="input-group-addon explain">推广距离(米)</span>
							<input type="text" name="promotionDistance" class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="input-group">
							<span class="input-group-addon explain">广告图片地址</span>
							<input type="text" name="adverImagesUrl" class="form-control">
						</div>
					</td>
					<td>
						<div class="input-group">
							<span class="input-group-addon explain">状态</span>
							<wb:html wbCode="pro-advertising-state" name="" type="select" />
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="input-group">
							<span class="input-group-addon explain">用户id</span>
							<input type="text" name="userId" class="form-control">
						</div>
					</td>
					<td>
						<div class="input-group">
							<span class="input-group-addon explain">链接</span>
							<input type="text" name="carrierUrl" class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="input-group">
							<span class="input-group-addon explain">广告语</span>
							<input type="text" name="adverSlogan" class="form-control">
						</div>
					</td>
					<td>
						<div class="input-group">
							<span class="input-group-addon explain">推广费用(分)</span>
							<input type="text" name="promotionExpenses" class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td colspan="2" style="text-align: right;">
						<div class="btn-group">
							<button type="button" class="btn btn-info" id="close-button">
								<i class="glyphicon glyphicon-remove"></i>
								取消
							</button>
							<button type="submit" class="btn btn-success">
								<i class="glyphicon glyphicon-ok"></i>
								添加
							</button>
						</div>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
</body>
</html>